package com.wyg.blog.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wyg.blog.model.blog.Type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TypeMapper {
    List<Type> getAllTypes();

    List<Type> getLatestTypes();

    Integer getTypeCount();

    IPage<Type> getSomeTypes(Page<?> page);

    Type getTypeById(Integer id);

    Type getTypeByName(String name);

    String getTypeName(Integer id);

    boolean addType(Type type);

    boolean updateTypeState(@Param("id") Integer id, @Param("state") boolean state);

    boolean updateType(@Param("id") Integer id, @Param("type") String type);

    boolean deleteType(Integer id);

    List<Type> getTypeByLike(String type);
}
